package com.saasovation.agilepm.port.adapter.spring;

import com.saasovation.agilepm.domain.model.product.ProductRepository;
import com.saasovation.agilepm.domain.model.product.backlogitem.BacklogItemRepository;
import com.saasovation.agilepm.domain.model.product.release.ReleaseRepository;
import com.saasovation.agilepm.domain.model.product.sprint.SprintRepository;
import com.saasovation.agilepm.domain.model.team.ProductOwnerRepository;
import com.saasovation.agilepm.domain.model.team.TeamMemberRepository;
import com.saasovation.agilepm.domain.model.team.TeamRepository;
import com.saasovation.agilepm.port.adapter.persistence.*;
import com.saasovation.common.domain.model.process.TimeConstrainedProcessTrackerRepository;
import com.saasovation.common.port.adapter.persistence.leveldb.LevelDBTimeConstrainedProcessTrackerRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DomainConfiguration {
    @Bean
    public BacklogItemRepository backlogItemRepository() {
        return new LevelDBBacklogItemRepository();
    }

    @Bean
    public ProductOwnerRepository productOwnerRepository() {
        return new LevelDBProductOwnerRepository();
    }

    @Bean
    public ProductRepository productRepository() {
        return new LevelDBProductRepository();
    }

    @Bean
    public ReleaseRepository releaseRepository() {
        return new LevelDBReleaseRepository();
    }

    @Bean
    public SprintRepository sprintRepository() {
        return new LevelDBSprintRepository();
    }

    @Bean
    public TeamMemberRepository teamMemberRepository() {
        return new LevelDBTeamMemberRepository();
    }

    @Bean
    public TeamRepository teamRepository() {
        return new LevelDBTeamRepository();
    }

    @Bean
    TimeConstrainedProcessTrackerRepository processTrackerRepository() {
        String aDirectoryPath = "data/leveldb/iddd_process_tracker_store";
        return new LevelDBTimeConstrainedProcessTrackerRepository(aDirectoryPath);
    }
}
